package com.study.designmodes.service.liabilityChain.v3;

import lombok.extern.slf4j.Slf4j;

/**
 * @author yangyanbin
 * @since 20230323
 **/
@Slf4j
public class OrderStockFilter implements OrderFilter<Order> {
    /**
     * 执行业务逻辑
     *
     * @param order t
     * @return boolean
     */
    @Override
    public boolean execute(Order order) {
        if (0 >= order.getStock()) {
            log.error("库存不足");
            return false;
        }
        return true;
    }
}
